/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import company.search.interfaces.SearchRequerimetsOR;
import interfaces.CandidateCapable;
import interfaces.SearchCapable;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import util.DateConverter;
import util.filter.Predicate;

/**
 *
 * @author damfercer
 * @param <T>
 */
@Entity
@Table(name = "search")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Search.findAll", query = "SELECT s FROM Search s"),
    @NamedQuery(name = "Search.findByIdSearch", query = "SELECT s FROM Search s WHERE s.idSearch = :idSearch"),
    @NamedQuery(name = "Search.findByDescription", query = "SELECT s FROM Search s WHERE s.description = :description"),
    @NamedQuery(name = "Search.findByCreateDate", query = "SELECT s FROM Search s WHERE s.createDate = :createDate"),
    @NamedQuery(name = "Search.findByLastSearchDate", query = "SELECT s FROM Search s WHERE s.lastSearchDate = :lastSearchDate"),
    @NamedQuery(name = "Search.findByIsPublicAndActive", query = "SELECT s FROM Search s WHERE s.isPublic = :isPublic AND s.active = :active"),
    @NamedQuery(name = "Search.findByMinimumAge", query = "SELECT s FROM Search s WHERE s.minimumAge = :minimumAge"),
    @NamedQuery(name = "Search.findByMaximumAge", query = "SELECT s FROM Search s WHERE s.maximumAge = :maximumAge")})
public class Search implements Serializable, Predicate<CandidateCapable>, SearchCapable {
    @Size(max = 100)
    @Column(name = "KEYWORDS")
    private String keywords;
    @Column(name = "AVAILABLE_JOBS")
    private Integer availableJobs;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "search")
    private List<CandidateSearchInterest> candidateSearchInterestList;
    @Size(max = 1000)
    @Column(name = "COMMENT")
    private String comment;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ACTIVE")
    private boolean active;
    @Column(name = "REQUIRED_VEHICLE")
    private Boolean requiredVehicle;
    @JoinColumn(name = "MINIMUM_TIME_AVAILABILITY", referencedColumnName = "ID_TIME_AVAILABILITY")
    @ManyToOne(fetch = FetchType.LAZY)
    private TimeAvailability minimumTimeAvailability;
    @JoinColumn(name = "RESIDENCE_COUNTRY", referencedColumnName = "ID_COUNTRY")
    @ManyToOne(fetch = FetchType.LAZY)
    private Country residenceCountry;
    @JoinColumn(name = "RESIDENCE_PROVINCE", referencedColumnName = "ID_PROVINCE")
    @ManyToOne(fetch = FetchType.LAZY)
    private Province residenceProvince;
    @JoinColumn(name = "RESIDENCE_TOWN", referencedColumnName = "ID_TOWN")
    @ManyToOne(fetch = FetchType.LAZY)
    private Town residenceTown;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "search", fetch = FetchType.LAZY)
    private List<SearchInterestAreaRequerimentOrOperator> searchInterestAreaRequerimentOrOperatorList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "search", fetch = FetchType.LAZY)
    private List<SearchLanguageInfoRequerimentAndOperator> searchLanguageInfoRequerimentAndOperatorList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "search", fetch = FetchType.LAZY)
    private List<SearchProfessionalInfoRequerimentOrOperator> searchProfessionalInfoRequerimentOrOperatorList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "search", fetch = FetchType.LAZY)
    private List<SearchRelocatingInfoRequerimentAndOperator> searchRelocatingInfoRequerimentAndOperatorList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "search", fetch = FetchType.LAZY)
    private List<SearchInterestAreaRequerimentAndOperator> searchInterestAreaRequerimentAndOperatorList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "search", fetch = FetchType.LAZY)
    private List<SearchRelocatingInfoRequerimentOrOperator> searchRelocatingInfoRequerimentOrOperatorList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "search", fetch = FetchType.LAZY)
    private List<SearchProfessionalInfoRequerimentAndOperator> searchProfessionalInfoRequerimentAndOperatorList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "search", fetch = FetchType.LAZY)
    private List<SearchLanguageInfoRequerimentOrOperator> searchLanguageInfoRequerimentOrOperatorList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "search", fetch = FetchType.LAZY)
    private List<SearchEducationalInfoRequerimentAndOperator> searchEducationalInfoRequerimentAndOperatorList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "search", fetch = FetchType.LAZY)
    private List<SearchEducationalInfoRequerimentOrOperator> searchEducationalInfoRequerimentOrOperatorList;
    @JoinColumn(name = "SEX", referencedColumnName = "ID_SEX")
    @ManyToOne(fetch = FetchType.LAZY)
    private Sex sex;
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_SEARCH")
    private Integer idSearch;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "DESCRIPTION")
    private String description;
    @Basic(optional = false)
    @NotNull
    @Column(name = "CREATE_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createDate;
    @Basic(optional = false)
    @NotNull
    @Column(name = "LAST_SEARCH_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastSearchDate;
    @Column(name = "IS_PUBLIC")
    private Boolean isPublic;
    @Column(name = "MINIMUM_AGE")
    private Integer minimumAge;
    @Column(name = "MAXIMUM_AGE")
    private Integer maximumAge;
    @JoinColumn(name = "EDUCATIONAL_INFO_MINIMUM_EDUCATIONAL_LEVEL", referencedColumnName = "ID_EDUCATIONAL_LEVEL")
    @ManyToOne(fetch = FetchType.LAZY)
    private EducationalLevel educationalInfoMinimumEducationalLevel;
    @JoinColumn(name = "PROFESSIONAL_INFO_MINIMUM_JOB_DURATION", referencedColumnName = "ID_JOB_DURATION")
    @ManyToOne(fetch = FetchType.LAZY)
    private JobDuration professionalInfoMinimumJobDuration;
    @JoinColumn(name = "PROFESSIONAL_INFO_SECTOR", referencedColumnName = "ID_SECTOR")
    @ManyToOne(fetch = FetchType.LAZY)
    private Sector professionalInfoSector;
    @JoinColumn(name = "OFFER_PROVINCE", referencedColumnName = "ID_PROVINCE")
    @ManyToOne(fetch = FetchType.LAZY)
    private Province offerProvince;
    @JoinColumn(name = "OFFER_COUNTRY", referencedColumnName = "ID_COUNTRY")
    @ManyToOne(fetch = FetchType.LAZY)
    private Country offerCountry;
    @JoinColumn(name = "FOLDER", referencedColumnName = "ID_COMPANY_FOLDER")
    @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private CompanyFolder folder;
    @JoinColumn(name = "COMPANY", referencedColumnName = "ID_COMPANY")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Company company;
    @JoinColumn(name = "EDUCATIONAL_INFO_SECTOR", referencedColumnName = "ID_SECTOR")
    @ManyToOne(fetch = FetchType.LAZY)
    private Sector educationalInfoSector;
    @Transient
    private CompanyAdquiredProfileFolderState companyAdquiredProfileFolderState;
    @Transient
    private List<Candidate> previewCandidateList;
    @Transient
    private Integer validCandidates;
    @Transient
    private Integer candidatesSinceLastView;

    public Search() {
    }

    public Search(Integer idSearch) {
        this.idSearch = idSearch;
    }

    public Search(Integer idSearch, String description, Date createDate, Date lastSearchDate) {
        this.idSearch = idSearch;
        this.description = description;
        this.createDate = createDate;
        this.lastSearchDate = lastSearchDate;
    }

    public Integer getIdSearch() {
        return idSearch;
    }

    public void setIdSearch(Integer idSearch) {
        this.idSearch = idSearch;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getLastSearchDate() {
        return lastSearchDate;
    }

    public void setLastSearchDate(Date lastSearchDate) {
        this.lastSearchDate = lastSearchDate;
    }

    public Boolean getIsPublic() {
        return isPublic;
    }

    public void setIsPublic(Boolean isPublic) {
        this.isPublic = isPublic;
    }

    public Integer getMinimumAge() {
        return minimumAge;
    }

    public void setMinimumAge(Integer minimumAge) {
        this.minimumAge = minimumAge;
    }

    public Integer getMaximumAge() {
        return maximumAge;
    }

    public void setMaximumAge(Integer maximumAge) {
        this.maximumAge = maximumAge;
    }

    public EducationalLevel getEducationalInfoMinimumEducationalLevel() {
        return educationalInfoMinimumEducationalLevel;
    }

    public void setEducationalInfoMinimumEducationalLevel(EducationalLevel educationalInfoMinimumEducationalLevel) {
        this.educationalInfoMinimumEducationalLevel = educationalInfoMinimumEducationalLevel;
    }

    public JobDuration getProfessionalInfoMinimumJobDuration() {
        return professionalInfoMinimumJobDuration;
    }

    public void setProfessionalInfoMinimumJobDuration(JobDuration professionalInfoMinimumJobDuration) {
        this.professionalInfoMinimumJobDuration = professionalInfoMinimumJobDuration;
    }

    public Sector getProfessionalInfoSector() {
        return professionalInfoSector;
    }

    public void setProfessionalInfoSector(Sector professionalInfoSector) {
        this.professionalInfoSector = professionalInfoSector;
    }

    public Province getOfferProvince() {
        return offerProvince;
    }

    public void setOfferProvince(Province offerProvince) {
        this.offerProvince = offerProvince;
    }

    public Country getOfferCountry() {
        return offerCountry;
    }

    public void setOfferCountry(Country offerCountry) {
        this.offerCountry = offerCountry;
    }

    public CompanyFolder getFolder() {
        return folder;
    }

    public void setFolder(CompanyFolder folder) {
        this.folder = folder;
    }

    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    public Sector getEducationalInfoSector() {
        return educationalInfoSector;
    }

    public void setEducationalInfoSector(Sector educationalInfoSector) {
        this.educationalInfoSector = educationalInfoSector;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSearch != null ? idSearch.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Search)) {
            return false;
        }
        Search other = (Search) object;
        if ((this.idSearch == null && other.idSearch != null) || (this.idSearch != null && !this.idSearch.equals(other.idSearch))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Search[ idSearch=" + idSearch + " ]";
    }

    public Sex getSex() {
        return sex;
    }

    public void setSex(Sex sex) {
        this.sex = sex;
    }

    public Boolean getRequiredVehicle() {
        return requiredVehicle;
    }

    public void setRequiredVehicle(Boolean requiredVehicle) {
        this.requiredVehicle = requiredVehicle;
    }

    public TimeAvailability getMinimumTimeAvailability() {
        return minimumTimeAvailability;
    }

    public void setMinimumTimeAvailability(TimeAvailability minimumTimeAvailability) {
        this.minimumTimeAvailability = minimumTimeAvailability;
    }

    public Country getResidenceCountry() {
        return residenceCountry;
    }

    public void setResidenceCountry(Country residenceCountry) {
        this.residenceCountry = residenceCountry;
    }

    public Province getResidenceProvince() {
        return residenceProvince;
    }

    public void setResidenceProvince(Province residenceProvince) {
        this.residenceProvince = residenceProvince;
    }

    public Town getResidenceTown() {
        return residenceTown;
    }

    public void setResidenceTown(Town residenceTown) {
        this.residenceTown = residenceTown;
    }

    @XmlTransient
    public List<SearchInterestAreaRequerimentOrOperator> getSearchInterestAreaRequerimentOrOperatorList() {
        return searchInterestAreaRequerimentOrOperatorList;
    }

    public void setSearchInterestAreaRequerimentOrOperatorList(List<SearchInterestAreaRequerimentOrOperator> searchInterestAreaRequerimentOrOperatorList) {
        this.searchInterestAreaRequerimentOrOperatorList = searchInterestAreaRequerimentOrOperatorList;
    }

    @XmlTransient
    public List<SearchLanguageInfoRequerimentAndOperator> getSearchLanguageInfoRequerimentAndOperatorList() {
        return searchLanguageInfoRequerimentAndOperatorList;
    }

    public void setSearchLanguageInfoRequerimentAndOperatorList(List<SearchLanguageInfoRequerimentAndOperator> searchLanguageInfoRequerimentAndOperatorList) {
        this.searchLanguageInfoRequerimentAndOperatorList = searchLanguageInfoRequerimentAndOperatorList;
    }

    @XmlTransient
    public List<SearchProfessionalInfoRequerimentOrOperator> getSearchProfessionalInfoRequerimentOrOperatorList() {
        return searchProfessionalInfoRequerimentOrOperatorList;
    }

    public void setSearchProfessionalInfoRequerimentOrOperatorList(List<SearchProfessionalInfoRequerimentOrOperator> searchProfessionalInfoRequerimentOrOperatorList) {
        this.searchProfessionalInfoRequerimentOrOperatorList = searchProfessionalInfoRequerimentOrOperatorList;
    }

    @XmlTransient
    public List<SearchRelocatingInfoRequerimentAndOperator> getSearchRelocatingInfoRequerimentAndOperatorList() {
        return searchRelocatingInfoRequerimentAndOperatorList;
    }

    public void setSearchRelocatingInfoRequerimentAndOperatorList(List<SearchRelocatingInfoRequerimentAndOperator> searchRelocatingInfoRequerimentAndOperatorList) {
        this.searchRelocatingInfoRequerimentAndOperatorList = searchRelocatingInfoRequerimentAndOperatorList;
    }

    @XmlTransient
    public List<SearchInterestAreaRequerimentAndOperator> getSearchInterestAreaRequerimentAndOperatorList() {
        return searchInterestAreaRequerimentAndOperatorList;
    }

    public void setSearchInterestAreaRequerimentAndOperatorList(List<SearchInterestAreaRequerimentAndOperator> searchInterestAreaRequerimentAndOperatorList) {
        this.searchInterestAreaRequerimentAndOperatorList = searchInterestAreaRequerimentAndOperatorList;
    }

    @XmlTransient
    public List<SearchRelocatingInfoRequerimentOrOperator> getSearchRelocatingInfoRequerimentOrOperatorList() {
        return searchRelocatingInfoRequerimentOrOperatorList;
    }

    public void setSearchRelocatingInfoRequerimentOrOperatorList(List<SearchRelocatingInfoRequerimentOrOperator> searchRelocatingInfoRequerimentOrOperatorList) {
        this.searchRelocatingInfoRequerimentOrOperatorList = searchRelocatingInfoRequerimentOrOperatorList;
    }

    @XmlTransient
    public List<SearchProfessionalInfoRequerimentAndOperator> getSearchProfessionalInfoRequerimentAndOperatorList() {
        return searchProfessionalInfoRequerimentAndOperatorList;
    }

    public void setSearchProfessionalInfoRequerimentAndOperatorList(List<SearchProfessionalInfoRequerimentAndOperator> searchProfessionalInfoRequerimentAndOperatorList) {
        this.searchProfessionalInfoRequerimentAndOperatorList = searchProfessionalInfoRequerimentAndOperatorList;
    }

    @XmlTransient
    public List<SearchLanguageInfoRequerimentOrOperator> getSearchLanguageInfoRequerimentOrOperatorList() {
        return searchLanguageInfoRequerimentOrOperatorList;
    }

    public void setSearchLanguageInfoRequerimentOrOperatorList(List<SearchLanguageInfoRequerimentOrOperator> searchLanguageInfoRequerimentOrOperatorList) {
        this.searchLanguageInfoRequerimentOrOperatorList = searchLanguageInfoRequerimentOrOperatorList;
    }

    @XmlTransient
    public List<SearchEducationalInfoRequerimentAndOperator> getSearchEducationalInfoRequerimentAndOperatorList() {
        return searchEducationalInfoRequerimentAndOperatorList;
    }

    public void setSearchEducationalInfoRequerimentAndOperatorList(List<SearchEducationalInfoRequerimentAndOperator> searchEducationalInfoRequerimentAndOperatorList) {
        this.searchEducationalInfoRequerimentAndOperatorList = searchEducationalInfoRequerimentAndOperatorList;
    }

    @XmlTransient
    public List<SearchEducationalInfoRequerimentOrOperator> getSearchEducationalInfoRequerimentOrOperatorList() {
        return searchEducationalInfoRequerimentOrOperatorList;
    }

    public void setSearchEducationalInfoRequerimentOrOperatorList(List<SearchEducationalInfoRequerimentOrOperator> searchEducationalInfoRequerimentOrOperatorList) {
        this.searchEducationalInfoRequerimentOrOperatorList = searchEducationalInfoRequerimentOrOperatorList;
    }

    public boolean getActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    /**
     * @return the companyAdquiredProfileFolderState
     */
    public CompanyAdquiredProfileFolderState getCompanyAdquiredProfileFolderState() {
        return companyAdquiredProfileFolderState;
    }

    /**
     * @param companyAdquiredProfileFolderState the companyAdquiredProfileFolderState to set
     */
    public void setCompanyAdquiredProfileFolderState(CompanyAdquiredProfileFolderState companyAdquiredProfileFolderState) {
        this.companyAdquiredProfileFolderState = companyAdquiredProfileFolderState;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public Integer getAvailableJobs() {
        return availableJobs;
    }

    public void setAvailableJobs(Integer availableJobs) {
        this.availableJobs = availableJobs;
    }

    @XmlTransient
    public List<CandidateSearchInterest> getCandidateSearchInterestList() {
        return candidateSearchInterestList;
    }

    public void setCandidateSearchInterestList(List<CandidateSearchInterest> candidateSearchInterestList) {
        this.candidateSearchInterestList = candidateSearchInterestList;
    }

    /**
     * @return the previewCandidateList
     */
    public List<Candidate> getPreviewCandidateList() {
        return previewCandidateList;
    }

    /**
     * @param previewCandidateList the previewCandidateList to set
     */
    public void setPreviewCandidateList(List<Candidate> previewCandidateList) {
        this.previewCandidateList = previewCandidateList;
    }

    /**
     * @return the validCandidates
     */
    public Integer getValidCandidates() {
        return validCandidates;
    }

    /**
     * @param validCandidates the validCandidates to set
     */
    public void setValidCandidates(Integer validCandidates) {
        this.validCandidates = validCandidates;
    }

    /**
     * @return the candidatesSinceLastView
     */
    public Integer getCandidatesSinceLastView() {
        return candidatesSinceLastView;
    }

    /**
     * @param candidatesSinceLastView the candidatesSinceLastView to set
     */
    public void setCandidatesSinceLastView(Integer candidatesSinceLastView) {
        this.candidatesSinceLastView = candidatesSinceLastView;
    }

    @Override
    public boolean test(CandidateCapable capable) {
        Candidate c=capable.getCandidate();
        boolean res=true;
        if(getSex()!=null && !getSex().equals(c.getSex())){
            return false;
        }
        if(getMinimumAge()!=null && DateConverter.dateDifference(c.getBirthDay())<getMinimumAge()){
            return false;
        }
        if(getMaximumAge()!=null && DateConverter.dateDifference(c.getBirthDay())>getMaximumAge()){
            return false;
        }
        if(getResidenceCountry()!=null && !getResidenceCountry().equals(c.getCountry())){
            return false;
        }
        if(getResidenceProvince()!=null && !getResidenceProvince().equals(c.getProvince())){
            return false;
        }
        if(getResidenceTown()!=null && !getResidenceTown().equals(c.getTown())){
            return false;
        }
        if(getMinimumTimeAvailability()!=null && getMinimumTimeAvailability().getValue()>=c.getTimeAvailability().getValue())  {
            return false;
        }
        if(getRequiredVehicle()!=null && getRequiredVehicle() && !c.getHasVehicle()){
            return false;
        }
        List<List<? extends Predicate<Candidate>>> requeriments=new ArrayList<List<? extends Predicate<Candidate>>>();
        if(getSearchEducationalInfoRequerimentAndOperatorList()!=null){
            requeriments.add(getSearchEducationalInfoRequerimentAndOperatorList());
        }
        if(getSearchInterestAreaRequerimentAndOperatorList()!=null){
            requeriments.add(getSearchInterestAreaRequerimentAndOperatorList());
        }
        if(getSearchLanguageInfoRequerimentAndOperatorList()!=null){
            requeriments.add(getSearchLanguageInfoRequerimentAndOperatorList());
        }
        if(getSearchProfessionalInfoRequerimentAndOperatorList()!=null){
            requeriments.add(getSearchProfessionalInfoRequerimentAndOperatorList());
        }
        if(getSearchRelocatingInfoRequerimentAndOperatorList()!=null){
            requeriments.add(getSearchRelocatingInfoRequerimentAndOperatorList());
        }
        for(List<? extends Predicate<Candidate>> requerimentsList: requeriments){
            for (Predicate<Candidate> predicate : requerimentsList) {
                res=res && predicate.test(c);
                if(!res){
                    break;
                }
            }
        }
        return res;
    }
    
    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }
    
    public List<SearchRequerimetsOR> getRequerimentsOR(){
        List<SearchRequerimetsOR> requerimentsOr=new ArrayList<SearchRequerimetsOR>();
        if(this.getSearchEducationalInfoRequerimentOrOperatorList()!=null && !this.getSearchEducationalInfoRequerimentOrOperatorList().isEmpty()){
            requerimentsOr.addAll(this.getSearchEducationalInfoRequerimentOrOperatorList());
        }
        if(this.getSearchInterestAreaRequerimentOrOperatorList()!=null && !this.getSearchInterestAreaRequerimentOrOperatorList().isEmpty()){
            requerimentsOr.addAll(this.getSearchInterestAreaRequerimentOrOperatorList());
        }
        if(this.getSearchLanguageInfoRequerimentOrOperatorList()!=null && !this.getSearchLanguageInfoRequerimentOrOperatorList().isEmpty()){
            requerimentsOr.addAll(this.getSearchLanguageInfoRequerimentOrOperatorList());
        }
        if(this.getSearchProfessionalInfoRequerimentOrOperatorList()!=null && !this.getSearchProfessionalInfoRequerimentOrOperatorList().isEmpty()){
            requerimentsOr.addAll(this.getSearchProfessionalInfoRequerimentOrOperatorList());
        }
        if(this.getSearchRelocatingInfoRequerimentOrOperatorList()!=null && !this.getSearchRelocatingInfoRequerimentOrOperatorList().isEmpty()){
            requerimentsOr.addAll(this.getSearchRelocatingInfoRequerimentOrOperatorList());
        }
        return requerimentsOr;
    }

    @Override
    public Search getSearch() {
        return this;
    }
    
}
